<?php
/**
 * Entry point for Zend Framework.
 *
 * PHP version 5
 *
 * @category   Web
 * @package    App
 * @subpackage Files
 * @author     Logger Testenborg <logger.testenborg@data2people.com>
 * @copyright  data2people.com
 * @license    Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt
 * @version    SVN: $Id: $
 *
 */

require_once dirname(__FILE__).'/global.php';

/**
 * Inits bootstrap
 *
 * @return void
 */
function init()
{
    initConfig();
    initView();
    initRoutes();
    initFrontend();
}

/**
 * Inits view
 *
 * @return void
 */
function initView()
{
    $ctrl = Zend_Controller_Front::getInstance();

    $view = new TS_View_Smarty();

    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);

    $viewRenderer->setViewScriptPathSpec(':controller/:action.:suffix')
    ->setViewScriptPathNoControllerSpec(':action.:suffix')
    ->setViewSuffix('tpl');

    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}

/**
 * Inits routes
 *
 * @return void
 */
function initRoutes()
{
}

/**
 * Init frontend
 *
 * @return void
 */
function initFrontend()
{
    $ctrl = Zend_Controller_Front::getInstance();
    $ctrl->addModuleDirectory(dirname(__FILE__)."/Mod");
    $ctrl->dispatch();
}
